local targetDmg = 25000

ACHIEVEMENT.Name			= "Heckler && Koch Addict"
ACHIEVEMENT.Description		= "Deal "..targetDmg.." points of damage using Heckler && Koch firearms."
ACHIEVEMENT.Icon			= nil --define if needed

function ACHIEVEMENT:ScaleNPCDamage (npc, hitgroup, dmg) --this would be called as if it were a hook to the function it is named after.
	local atk = dmg:GetAttacker()
	if (!IsValid(atk) or !atk:IsPlayer()) then return end
	
	if ( !dmg:IsBulletDamage() ) then return end // It's obviously not H&K weaponry...
	
	local weap = atk:GetActiveWeapon()
	if ( !IsValid( weap ) ) then return end
	
	// Check it's an Heckler & Koch weapon.
	local name = weap.PrintName or ""
	--printd( name )
	if ( string.Left( name, 2 ) != "HK" ) then return end
	
	printd ("HK pass.")
	
	// Add the damage on.
	local damage = self:GetValue( atk, "damage", 0 )
	self:SetValue( atk, "damage", math.ceil(damage + dmg:GetDamage()) )
	--printd( damage, damage + dmg:GetDamage(), self:GetValue( atk, "damage", 0 ) )
end

function ACHIEVEMENT:CompletionConditions (ply) --if this returns true, they earn the achievement
	return self:GetValue( ply, "damage", 0 ) > targetDmg
end

function ACHIEVEMENT:FractionComplete (ply)
	return self:GetValue( ply, "damage", 0 ) / targetDmg --and hopefully YOU can round this down to 1
end
function ACHIEVEMENT:StatusText( ply )
	return math.min( self:GetValue( ply, "damage", 0 ), targetDmg ) .. "/" ..targetDmg
end
